package servlet;

import mapper.DelName;
import model.Test;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/maindel")
public class DelPost extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Test test = new Test();
        test.setId(Integer.parseInt(request.getParameter("ID")));
        boolean delName = new DelName().Del(test);
        if (delName == true){
            response.getWriter().write("true");
        }else {
            response.getWriter().write("false");
        }

    }

}
